<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------


use think\Route;

Route::get('api/:version/banner/:id','api/:version.Banner/getBanner');//tp5提供的 URL访问模式 路由

Route::get('api/:version/theme','api/:version.Theme/getSimpleList');

Route::get('api/:version/theme/:id','api/:version.Theme/getComplexOne');

//Route::get('api/:version/product/recent','api/:version.Product/getRecent');
//Route::get('api/:version/product/by_category/','api/:version.Product/getAllProductInCategory');
//Route::get('api/:version/product/:id','api/:version.Product/getOne',[],['id'=>'\d+']);


Route::group('api/:version/product',function (){
    Route::get('/by_category','api/:version.Product/getAllProductInCategory');
    Route::get('/:id','api/:version.Product/getOne',[],['id'=>'\d+']);
    Route::get('/recent','api/:version.Product/getRecent');
});

Route::get('api/:version/category','api/:version.Category/getAllCategories');

//Route::get('api/:version/category','api/:version.Category/getDetailCategories');//分类带各商品列表

//token验证
Route::post('api/:version/token/user','api/:version.Token/getToken');

Route::post('api/:version/address','api/:version.Address/createOrUpdateAddress');

//订单提交
Route::post('api/:version/order','api/:version.Order/placeOrder');
Route::post('api/:version/order/by_user','api/:version.Order/getSummaryByUser');//历史订单
Route::get('api/:version/order/:id','api/:version.Order/getDetail',[],['id'=>'\d+']);//所以这是干嘛的

Route::post('api/:version/pay/pre_order','api/:version.Pay/getPreOrder');
Route::post('api/:version/pay/notify','api/:version.Pay/receiveNotify');
Route::post('api/:version/pay/re_notify', 'api/:version.Pay/redirectNotify');
